package hello; /**
 * Regular Expression
 */
import java.util.Scanner;

public class StringRegExpReplace {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("Please input a string:");
        String str = scanner.next();

        System.out.println("Please input a regexp:");
        String reg = scanner.next();

        System.out.println("Replaced by:");
        String rep = scanner.next();

        System.out.println("GET>>> \r\n" + str.replaceAll(reg, rep));
    }
}